#pragma once
#include <unistd.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>

/*socket address wapper*/
struct socket_address {
	char *ip_address;
	int port;
};

/*socket related wapper functions*/
extern int socket_create();
extern int socket_bind(int socketfd, struct socket_address *local_addr);
extern int socket_connect(int socket_fd, struct socket_address *endpoint_address);
extern int socket_listen(int socket_fd);
extern int socket_accept(int listen_socket_fd, struct socket_address *peer_addresss);
extern int socket_send(int socket_fd, char *msg, unsigned length);
extern int socket_recv(int socket_fd, char *buf, unsigned length);